package com.koro.feign;

import com.koro.dto.SaveOrdersDTO;
import com.koro.dto.SaveShopCartDTO;
import com.koro.vo.FindShopCartVO;
import com.koro.vo.ResponseObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "shop-service-orders")
public interface OrderFeignClient {

    @PostMapping("/orders/save")
    ResponseObject<Integer> save(@RequestBody SaveOrdersDTO dto);

    @PostMapping("/shopCart/save")
    ResponseObject<Integer> save1(@RequestBody SaveShopCartDTO dto);

    @GetMapping("/shopCart/findByUserId")
    ResponseObject<List<FindShopCartVO>> findByUserId(@RequestParam("id") Integer id);

}
